export default class CatInteraction {
    constructor(scene) {
        this.scene = scene;
        this.cats = [];
        this.initInteractions();
    }

    initInteractions() {
        this.scene.input.on('gameobjectdown', (pointer, gameObject) => {
            if (gameObject.catData) {
                this.petCat(gameObject);
            }
        });
    }

    petCat(cat) {
        cat.play('happy_anim');
        this.scene.sound.play('purr');
        
        // 随机奖励金币
        if (Phaser.Math.Between(1, 10) > 7) {
            this.scene.events.emit('add_gold', 50);
        }
    }
}